<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <title>圣诞抽奖--太厉害啦</title>
    <link rel="stylesheet" href="css/main.css">
	<script type="text/javascript" src="js/zepto.min.js"></script>

	<style>
		 .weizj {
			 position: absolute;
			 top:0;
			 left:0;
			 display: none;
		 }

		.getallprize {
			position: absolute;
			top:0;
			left:0;
			display: none;
		}

		.phoneNum {
			width: 60%;
			margin-left: 20%;
			margin-top: 92%;
			border: 1px solid red;
			height: 35px;
			font-size: 20px;
		}

		.award p {
			line-height: 40px;
			font-size: 28px;
			color: #fff;
			font-family: 微软雅黑;
			padding-left: 30%;
			padding-top: 23px;
		}
	</style>
</head>

  <script>
	     //未中奖显示未中奖页面
         $(document).ready(function(){
             var weizj=document.getElementById("weizj");
             var getallprize=document.getElementById("getallprize");

             function GetQueryString(name) {
                 var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
                 var r = window.location.search.substr(1).match(reg);
                 if (r != null)return unescape(r[2]);
                 return null;
             }


             //成功投中,,,领取流量
             var win = GetQueryString("win");


             if (win == 1){
                 weizj.style.display = "none";
                 getallprize.style.display = "block";
			 }else if (win == 0) {
                 weizj.style.display = "block";
                 getallprize.style.display = "none";
			 }







             $(".attend").tap(function (){
                 alert("我要参加");

                 location.href = "index.html"

             });
             $(".award").tap(function (){
                 alert("兑奖");

                 var phoneNum=document.getElementById("phoneNum").value;
                 alert(phoneNum);

                 if (!phoneNum){
                     alert("填写手机号");
                     return;
				 }

                 //保存用户中奖信息接口
                 $.ajax({
                     type: "GET",
                     url: "/Christmas/saveWinner",
                     data: "PhoneNo="+phoneNum+"winType=2",
                     dataType: 'json',
                     json: 'callback',
                     success: function (data) {
                         alert("提交成功,稍后为您兑奖!")
                     }
                 });
             })

         });



  </script>
<body>

<div id="weizj" class="weizj">
	<div class="weicz">
		<img src="img/5/未猜中@2x.png">
	</div>
	<div class="attend">
		<p>我也要玩</p>
	</div>
</div>


	<div id="getallprize" class="getallprize">
		<div class="qz2">
			<img src="img/5/太厉害啦@2x.png">
		</div>
		<div class="banner">
			<img src="img/3/banner@2x.png">
		</div>
		<p class="wz" style="text-align: center;">
			恭喜你获得好友分享的圣诞礼物
		</p>

		<input id="phoneNum" class="phoneNum" placeholder="请输入你的手机号" type="text" value="">

		<div class="award">
			<p>我要兑奖</p>
		</div>
		<div class="attend">
			<p>我也要玩</p>
		</div>



	</div>

</body>
</html>